package org.millioncall.yueyoga.admin.dao;

import java.util.List;
import java.util.Map;

import org.millioncall.openplatform.common.PaginatedList;
import org.millioncall.yueyoga.admin.model.AviatorExpression;
import org.millioncall.yueyoga.admin.model.Goods;

public interface GoodsDAO {

	public int save(Map<String, Object> map);

	public int update(Map<String, Object> map);

	public int deleteById(Integer id);

	public int deleteByIds(String[] ids);

	public Goods findGoodsById(Integer id);

	/** 条件分页查询 **/
	public PaginatedList<Goods> findGoodsInPage(Map<String, Object> map,
			int start, int limit);
	//--获取编号
	public String getNextCode();

	public List<Goods> findAll(Map<String, Object> map);

	public Goods findGoodsByCode(String code);
	
	public int updateGoodCounts(Map<String, Object> context);

	public List<Goods> findAllByOrganizationId(String organizationId);
	
	/**
	 * 查询所有符合aviator表达式的商品
	 * 
	 * @param expression
	 * @param params
	 * @param start
	 * @param limit
	 * @return
	 */
	public List<Goods> getAllGoodsWithAviator(Map<String, Object> params,
			AviatorExpression expression, Map<String, Object> aviatorParams,
			int limit);

}